<template>
  <div class="home-container">
    <h1>首页</h1>
    <el-card class="welcome-card">
      <div class="welcome-content">
        <div class="welcome-text">
          <h2>欢迎使用医院陪护系统</h2>
          <p>在这里您可以快速预约护工服务，查看订单状态，与护工在线沟通。</p>
        </div>
        <el-image 
          class="welcome-image"
          src="https://dnuicompanion.oss-cn-beijing.aliyuncs.com/14.png"
          fit="cover"
        ></el-image>
      </div>
    </el-card>
    
    <div class="feature-section">
      <el-row :gutter="20">
        <el-col :span="12">
          <el-card class="feature-card" @click="navigateTo('/patient/consultation')">
            <div class="feature-icon">
              <el-icon><ChatDotRound /></el-icon>
            </div>
            <h3>在线咨询</h3>
            <p>随时与护工沟通，解答您的疑问</p>
          </el-card>
        </el-col>
        <el-col :span="12">
          <el-card class="feature-card" @click="navigateTo('/patient/order')">
            <div class="feature-icon">
              <el-icon><Document /></el-icon>
            </div>
            <h3>订单管理</h3>
            <p>便捷查看订单状态，轻松管理服务</p>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script setup>
import { ChatDotRound, Document } from '@element-plus/icons-vue'
import { useRouter } from 'vue-router'

const router = useRouter()

// 导航到指定路由
const navigateTo = (path) => {
  router.push(path)
}
</script>

<style scoped>
.home-container {
  padding: 20px;
}

h1 {
  margin-bottom: 20px;
  font-size: 24px;
  color: #303133;
}

.welcome-card {
  margin-bottom: 30px;
}

.welcome-content {
  display: flex;
  align-items: center;
  gap: 30px;
}

.welcome-text {
  flex: 1;
}

.welcome-text h2 {
  font-size: 22px;
  color: #303133;
  margin-bottom: 15px;
}

.welcome-text p {
  font-size: 16px;
  color: #606266;
  line-height: 1.6;
}

.welcome-image {
  width: 200px;
  height: 200px;
  border-radius: 8px;
}

.feature-section {
  margin-top: 30px;
}

.feature-card {
  height: 100%;
  text-align: center;
  transition: transform 0.3s;
  cursor: pointer;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 40px;
  color: #409eff;
  margin-bottom: 15px;
}

.feature-card h3 {
  font-size: 18px;
  color: #303133;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 14px;
  color: #606266;
  line-height: 1.5;
}
</style> 